package com.easy.easy.dao;

import com.easy.easy.bean.Category;
import com.easy.easy.bean.Product;
import com.easy.easy.util.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ProductDao {
    int add(@Param("product") Product product);

    int delete(@Param("id")int id);

    int edit(@Param("product")Product product);

    Product getByID(@Param("id") int id);

    List<Product> getList(@Param("page") Page page, @Param("text")String text);

    List<Product> getlist(@Param("page") Page page, @Param("text")String text);

    List<Category> getChildren(@Param("id")Integer id);

    int getCount(@Param("text")String text);

    List<Category> getParent(@Param("id") int id);

    List<Product> getAll();
}
